﻿using System;
using System.Collections.Generic;
using System.Text;
using DO.Clustering;

namespace BLL.Relations.VectorDistances
{
    /// <summary>
    /// Feature freq can be any value of {0,1,2}, 0-absence, 1-presence, 2-2 or more occurance
    /// </summary>
    public interface IDistanceCalculator
    {
        /// <summary>
        /// without weight
        /// </summary>
        /// <param name="FeatureFreq1"></param>
        /// <param name="FeatureFreq2"></param>
        /// <param name="contributingFeatures"></param>
        /// <returns></returns>
        double CalculateDistance(
            Dictionary<int, FeatureFreq> FeatureFreq1,
            Dictionary<int, FeatureFreq> FeatureFreq2, 
            ref Dictionary<int,int> contributingFeatures);

        /// <summary>
        /// with weight
        /// </summary>
        /// <param name="FeatureFreq1"></param>
        /// <param name="FeatureFreq2"></param>
        /// <param name="FeatureWeights"></param>
        /// <param name="useNGramSimilarity"></param>
        /// <param name="ngramLen"></param>
        /// <param name="contributingFeatures"></param>
        /// <returns></returns>
        double CalculateDistance(
            Dictionary<int, FeatureFreq> FeatureFreq1,
            Dictionary<int, FeatureFreq> FeatureFreq2, 
            Dictionary<int, double> FeatureWeights,
            bool useNGramSimilarity, int ngramLen,
            ref Dictionary<int, int> contributingFeatures);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="FeatureFreq1"></param>
        /// <param name="FeatureFreq2"></param>
        /// <param name="FeatureWeights"></param>
        /// <param name="FeatureStemmings1">Feature id -> root</param>
        /// <param name="FeatureStemmings2">root -> list of Feature ids</param>
        /// <param name="contributingFeatures"></param>
        /// <returns></returns>
        double CalculateDistance(
            Dictionary<int, FeatureFreq> FeatureFreq1,
            Dictionary<int, FeatureFreq> FeatureFreq2,
            Dictionary<int, double> FeatureWeights,
            Dictionary<int, string> FeatureStemmings1,
            Dictionary<string, List<int>> FeatureStemmings2,
            ref Dictionary<int, int> contributingFeatures);
    }
}
